<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>


<c:if test="${code==1}">
	<form id="pagerForm" method="post" action="userAction.action?toResult=searchUser&rightId=${rightId}">
		<input type="hidden" name="pageNum" value="${page.currentPage }" /> 
		<input type="hidden" name="pageSize" value="${page.pageSize }" />
		<input type="hidden" name="mobile" value="${mobile }" />
		<input type="hidden" name="kdtInviteCodeFlag" value="${kdtInviteCodeFlag }" />
	</form>

	<form onsubmit="return navTabSearch(this);" action="userAction.action?toResult=searchUser&rightId=${rightId}" method="post">
		<div class="pageHeader">
			<input type="hidden" name="init" value=0>
			<div class="searchBar">
				<table class="searchContent">
					<tr>
						<td>电话: <input type="text" name="mobile" value="${mobile}" />
						</td>
						
						<td>BD邀请用户: 
						<select name="kdtInviteCodeFlag" id="kdtInviteCode_id">
							<option  value="0" <c:if test="#request.kdtInviteCodeFlag==0">selected="selected"</c:if>>邀请用户</option>
							<option  value="1" <c:if test="#request.kdtInviteCodeFlag==1">selected="selected"</c:if>>所有用户</option>
						</select>
						</td>
						
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td>
							<div class="buttonActive">
								<div class="buttonContent">
									<button type="submit">检索</button>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="pageContent">
			<div class="panelBar">
				<ul class="toolBar">
					<c:forEach items="${righSubtList}" var="rightsub">
						<!-- 添加  -->
						<c:if test="${fn:contains(rightsub.rightValue,'addUser')}">
							<li><a class="add" href="${rightsub.rightValue}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 修改  -->
						<c:if test="${fn:contains(rightsub.rightValue,'updateUser')}">
							<li><a class="edit" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 删除 -->
						<c:if test="${fn:contains(rightsub.rightValue,'deleteUser')}">
							<li><a class="delete" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="ajaxTodo" title="确认要删除吗？"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 用户订单 -->
						<c:if test="${fn:contains(rightsub.rightValue,'getUserOrders')}">
							<li><a class="edit" href="${rightsub.rightValue}?userId={sid_support}"  target="dialog"  rel="dlg_page1" title="客户订单查询" width="1000" height="600"><span>${rightsub.rightName}</span></a>
						</li>
							<li class="line">line</li>
						</c:if>
						
						<!-- 充值记录 -->
						<c:if test="${fn:contains(rightsub.rightValue,'getPayInfo')}">
							<li><a class="edit" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="dialog" width="900" height="550" mask="true"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 验证码短信查询 -->
						<c:if test="${fn:contains(rightsub.rightValue,'findSmsRecordByMobile')}">
							<li><a class="edit" href="${rightsub.rightValue}?userId={sid_support}"  target="dialog"  rel="dlg_page1" title="验证码短信查询" width="1000" height="600"><span>${rightsub.rightName}</span></a>
						</li>
							<li class="line">line</li>
						</c:if>
	<%-- 					<!-- 给客户发送短消息 -->
						<c:if test="${fn:contains(rightsub.rightValue,'sendSMS')}">
							<li><a class="add" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}"  target="dialog"  rel="navTab" ><span>${rightsub.rightName}</span></a>
						</li>
							<li class="line">line</li>
						</c:if> --%>
						<!-- 清零  -->
						<c:if test="${fn:contains(rightsub.rightValue,'clearBalance')}">
							<li><a class="edit" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						
						<!-- 优惠券详情 -->
						<c:if test="${fn:contains(rightsub.rightValue,'getUserGift')}">
							<li><a class="edit" href="${rightsub.rightValue}?userId={sid_support}"  target="dialog"  rel="dlg_page1" title="客户订单查询" width="1000" height="600"><span>${rightsub.rightName}</span></a>
						</li>
							<li class="line">line</li>
						</c:if>
						
					</c:forEach>
				</ul>
			</div>
			<table class="list" width="100%" layoutH="138">
				<thead>
					<tr>
						<th align="center">序号</th>
						<th align="center">用户名</th>
						<th align="center">状态</th>
						<th align="center">注册时间</th>
						<th align="center">电话</th>
						<th align="center">邀请码</th>
						<th align="center">邮箱</th>
						<th align="center">金额</th>
						<th align="center">备注</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.data}" var="user" varStatus="st">
						<tr target="sid_support" rel="${user.id}">
							<th width="1%" align="center">${page.pageSize*(page.currentPage-1)+1+st.index}
							</th>
							<th width="5%" align="center">${user.username}
							</th>
							<th width="2%" align="center">
								<c:if test="${user.locked ==0}"><span style="color:blue">启用</span></c:if> 
								<c:if test="${user.locked ==1}"><span style="color:gray">禁用</span></c:if>
							</th>
							<th width="5%" align="center">
								<fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
							</th>
							<th width="5%" align="center">${user.mobile}
							</th>
							<th width="5%" align="center">${user.kdtInviteCode}
							</th>
							<th width="5%" align="center">${user.email}
							</th>
							<th width="5%" align="center">${user.user_balance}
							</th>
							<th width="7%" align="center">${user.content}
							</th>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div class="panelBar">
				<div class="pages">
					<span>共${page.totalNum }条，共${page.totalPage }页</span>
				</div>
				<div class="pagination" targetType="navTab" totalCount="${page.totalNum }" numPerPage="${page.pageSize }" pageNumShown="10" currentPage="${page.currentPage }"></div>
			</div>
		</div>
	</form>
</c:if>
<c:if test="${code==0}">
	${message}
</c:if>